package com.itheima.pinda.service.impl;

import com.itheima.pinda.service.ReloadDroolsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 项目启动时加载最新规则
 *
 * @author llhuang10
 * @date 2021/10/12 16:01
 */
@Slf4j
@Component
public class CommandLineRunnerImpl implements CommandLineRunner {

    @Resource
    private ReloadDroolsService reloadDroolsService;

    @Override
    public void run(String... args) throws Exception {
        reloadDroolsService.reload();
    }
}
